package com.idak.rdv.db;

// Generated 15 juin 2012 23:31:31 by Hibernate Tools 3.4.0.CR1

import static javax.persistence.GenerationType.IDENTITY;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Patient generated by hbm2java
 */
@SuppressWarnings("serial")
@Entity
@Table(name = "PATIENT", catalog = "rdv")
public class Patient implements java.io.Serializable {

	private Integer patientId;
	private String lastName;
	private String firstName;
	private String phoneNumber;
	private Date dtCreate;
	private Date dtModif;
	private Date dtEnd;
	private List<Appointment> appointments = new ArrayList<Appointment>(0);

	public Patient() {
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "PATIENT_ID", unique = true, nullable = false)
	public Integer getPatientId() {
		return this.patientId;
	}

	public void setPatientId(Integer patientId) {
		this.patientId = patientId;
	}

	@Column(name = "LAST_NAME", nullable = false, length = HibernateConstant.LENGTH.LAST_NAME)
	public String getLastName() {
		return this.lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	@Column(name = "FIRST_NAME", nullable = false, length = HibernateConstant.LENGTH.FIRST_NAME)
	public String getFirstName() {
		return this.firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	@Column(name = "PHONE_NUMBER", nullable = false, length = HibernateConstant.LENGTH.DATE)
	public String getPhoneNumber() {
		return this.phoneNumber;
	}

	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "DT_CREATE", nullable = false, length = HibernateConstant.LENGTH.DATETIME)
	public Date getDtCreate() {
		return this.dtCreate;
	}

	public void setDtCreate(Date dtCreate) {
		this.dtCreate = dtCreate;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "DT_MODIF", length = HibernateConstant.LENGTH.DATETIME)
	public Date getDtModif() {
		return this.dtModif;
	}

	public void setDtModif(Date dtModif) {
		this.dtModif = dtModif;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "DT_END", length = HibernateConstant.LENGTH.DATETIME)
	public Date getDtEnd() {
		return this.dtEnd;
	}

	public void setDtEnd(Date dtEnd) {
		this.dtEnd = dtEnd;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "patient")
	public List<Appointment> getAppointments() {
		return this.appointments;
	}

	public void setAppointments(List<Appointment> appointments) {
		this.appointments = appointments;
	}

}
